def twoSum( nums, target):
    hash={}
    for i in range(len(nums)):
        if target-nums[i] in hash: return [i,hash[target-nums[i]]]
        else: hash[nums[i]]=i
    return []

nums=list(map(int,input().split()))
target=int(input())
print(twoSum( nums, target))
    
    